package service.impl;

import dao.IPersonDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pojo.Person;
import service.IPersonService;

import java.util.List;

@Service
public class PersonServiceImpl implements IPersonService {

    @Autowired
    private IPersonDao personDao;

    public List<Person> getAllPerson() {
        return personDao.getAllPerson();
    }

    public Person getPersonByPid(int pid) {
        return personDao.getPersonByPid(pid);
    }

    public boolean savePerson(Person p) {
        return personDao.savePerson(p) > 0;
    }

    public boolean updatePerson(Person p) {
        return personDao.updatePerson(p) > 0;
    }
}
